#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  int tot = 0;
  vector<pair<char, int>> v(n);
  for (int i = 1; i <= n; i++) {
    char c;
    int l;
    cin >> c >> l;
    v[i] = {c, l};
    tot += l;
    if (tot > 100) {
      cout << "Too Long";
      return 0;
    }
  }

  for (int i = 1; i <= n; i++) {
    char c;
    int l;
    // tie( c,l)= v[i] ;
    c = v[i].first;
    l = v[i].second;
    for (int j = 1; j <= l; j++)
      cout << c;
  }

  return 0;
}